//quick C 1
#include <stdio.h>
#include <stdlib.h>



unsigned long int fib(int n);
unsigned long int fib2(int n);
main(){
	printf("%lu\n",fib2(100) );
	printf("%d\n",fib(200) );
}

unsigned long int fib(int n) //递归法
{
	if(0==n)return 0;
	if(1==n)return 1;
	//注意观察变量与常数的比较方法，想想为什么这么写
	return fib(n-1)+fib(n-2);
}

unsigned long int fib2(int n) //迭代法
{
	
	if(0==n)return 0;
	if(1==n)return 1;
	unsigned long int forward1,forward2,now;
	forward1=0;
	forward2=1;
	now=0;
	for (int i=2;i<n+1;i++)
	{
		now=forward1+forward2;
		forward1=forward2;
		forward2=now;
	}	
	return now;
}